package com.ostrich.cloud.ostrichBusinessWeb.client;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ostrich.cloud.common.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Date;

@FeignClient(contextId = "orderWebClient",name="ostrichBusinessWeb")
@Api("商家管理订单相关接口")
public interface OrderWebClient {
//    @GetMapping("selectOrder")
//    @ApiOperation("商家查询全部订单接口")
//    public Result selectOrder(@RequestParam("current")Integer current
//            ,@RequestParam("size")Integer size);

//    @GetMapping("selectOrderByNo")
//    @ApiOperation("商家根据订单编号查询订单接口")
//    public Result selectOrderByNo(@RequestParam("current")Integer current,
//                                  @RequestParam("size")Integer size, @RequestParam("orderNo")Long orderNo);
    @GetMapping("selectOrderByTime")
    @ApiOperation("商家根据订单时间查询订单接口")
    public Result selectOrderByTime(@RequestParam("current")Integer current,
                                    @RequestParam("size")Integer size,
                                    @RequestParam("startTime") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
                                        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")Date startTime,
                                    @RequestParam("finishTime") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
                                        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") Date finishTime,
                                    @RequestParam("orderNo") Long orderNo);

    @PutMapping("putSales")
    @ApiOperation("商家退款接口接口")
    public Result putSales(@RequestParam("orderNo") Long orderNo);

    @PutMapping("putOrder")
    @ApiOperation("商家根据订单编号修改状态")
    public Result putOrder(Long orderNo);




}
